/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Verito Ramirez
 *         Victor Jaramillo
 */
@Entity
@Table(name = "cxc_detalleretencion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxcDetalleRetencion.findAll", query = "SELECT c FROM CxcDetalleRetencion c"),
    @NamedQuery(name = "CxcDetalleRetencion.findBycxcCodigoDetRet", query = "SELECT c FROM CxcDetalleRetencion c WHERE c.cxcCodigoDetRet = :cxcCodigoDetRet"),
    @NamedQuery(name = "CxcDetalleRetencion.findBycxcBaseImponibleDetRet", query = "SELECT c FROM CxcDetalleRetencion c WHERE c.cxcBaseImponibleDetRet = :cxcBaseImponibleDetRet"),
    @NamedQuery(name = "CxcDetalleRetencion.findBycxcPorcentajeDetRet", query = "SELECT c FROM CxcDetalleRetencion c WHERE c.cxcPorcentajeDetRet = :cxcPorcentajeDetRet"),
    @NamedQuery(name = "CxcDetalleRetencion.findBycxcValorDetRet", query = "SELECT c FROM CxcDetalleRetencion c WHERE c.cxcValorDetRet = :cxcValorDetRet"),
    @NamedQuery(name = "CxcDetalleRetencion.findBycxcCodigoCabRet", query = "SELECT c FROM CxcDetalleRetencion c WHERE c.cxcCodigoCabRet = :codigoCabRet"),
    @NamedQuery(name = "CxcDetalleRetencion.findBycxpCodigoRet", query = "SELECT c FROM CxcDetalleRetencion c WHERE c.cxpCodigoRet = :CodigoRet"),
    @NamedQuery(name = "CxcDetalleRetencion.findBycxpCodigoImp", query = "SELECT c FROM CxcDetalleRetencion c WHERE c.cxpCodigoImp = :CodigoImp")})


public class CxcDetalleRetencion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CXC_CODIGO_DETRET")
    private String cxcCodigoDetRet;
    @Column(name = "CXC_BASEIMPONIBLE_DETRET")
    private Double cxcBaseImponibleDetRet;
    @Column(name = "CXC_PORCENTAJE_DETRET")
    private Double cxcPorcentajeDetRet;
    @Column(name = "CXC_VALOR_DETRET")
    private Double cxcValorDetRet;
    @JoinColumn(name = "CXC_CODIGO_CABRET", referencedColumnName = "CXC_CODIGO_CABRET")
    @ManyToOne(optional = false)
    private CxcCabeceraRetencion cxcCodigoCabRet;
    @JoinColumn(name = "CXP_CODIGO_RET", referencedColumnName = "CXP_CODIGO_RET")
    @ManyToOne(optional = false)
    private CxpRetencion cxpCodigoRet;
    @JoinColumn(name = "CXP_CODIGO_IMP", referencedColumnName = "CXP_CODIGO_IMP")
    @ManyToOne(optional = false)
    private CxpImpuesto cxpCodigoImp;

    public CxcDetalleRetencion() {
    }

    public CxcDetalleRetencion(String cxcCodigoDetRet, Double cxcBaseImponibleDetRet, Double cxcPorcentajeDetRet, Double cxcValorDetRet, CxcCabeceraRetencion cxcCodigoCabRet, CxpRetencion cxpCodigoRet, CxpImpuesto cxpCodigoImp) {
        this.cxcCodigoDetRet = cxcCodigoDetRet;
        this.cxcBaseImponibleDetRet = cxcBaseImponibleDetRet;
        this.cxcPorcentajeDetRet = cxcPorcentajeDetRet;
        this.cxcValorDetRet = cxcValorDetRet;
        this.cxcCodigoCabRet = cxcCodigoCabRet;
        this.cxpCodigoRet = cxpCodigoRet;
        this.cxpCodigoImp = cxpCodigoImp;
    }

    public CxcCabeceraRetencion getCxpCodigoCabRet() {
        return cxcCodigoCabRet;
    }

    public void setCxpCodigoCabRet(CxcCabeceraRetencion cxcCodigoCabRet) {
        this.cxcCodigoCabRet = cxcCodigoCabRet;
    }

    public CxpImpuesto getCxpCodigoImp() {
        return cxpCodigoImp;
    }

    public void setCxpCodigoImp(CxpImpuesto cxpCodigoImp) {
        this.cxpCodigoImp = cxpCodigoImp;
    }

    public CxpRetencion getCxpCodigoRet() {
        return cxpCodigoRet;
    }

    public void setCxpCodigoRet(CxpRetencion cxpCodigoRet) {
        this.cxpCodigoRet = cxpCodigoRet;
    }

    public Double getCxcBaseImponibleDetRet() {
        return cxcBaseImponibleDetRet;
    }

    public void setCxcBaseImponibleDetRet(Double cxcBaseImponibleDetRet) {
        this.cxcBaseImponibleDetRet = cxcBaseImponibleDetRet;
    }

    public CxcCabeceraRetencion getCxcCodigoCabRet() {
        return cxcCodigoCabRet;
    }

    public void setCxcCodigoCabRet(CxcCabeceraRetencion cxcCodigoCabRet) {
        this.cxcCodigoCabRet = cxcCodigoCabRet;
    }

    public String getCxcCodigoDetRet() {
        return cxcCodigoDetRet;
    }

    public void setCxcCodigoDetRet(String cxcCodigoDetRet) {
        this.cxcCodigoDetRet = cxcCodigoDetRet;
    }

    public Double getCxcPorcentajeDetRet() {
        return cxcPorcentajeDetRet;
    }

    public void setCxcPorcentajeDetRet(Double cxcPorcentajeDetRet) {
        this.cxcPorcentajeDetRet = cxcPorcentajeDetRet;
    }

    public Double getCxcValorDetRet() {
        return cxcValorDetRet;
    }

    public void setCxcValorDetRet(Double cxcValorDetRet) {
        this.cxcValorDetRet = cxcValorDetRet;
    }
    
    
    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxcCodigoDetRet != null ? cxcCodigoDetRet.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxcDetalleRetencion)) {
            return false;
        }
        CxcDetalleRetencion other = (CxcDetalleRetencion) object;
        if ((this.cxcCodigoDetRet == null && other.cxcCodigoDetRet != null) || (this.cxcCodigoDetRet != null && !this.cxcCodigoDetRet.equals(other.cxcCodigoDetRet))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "calses.CxcDetalleRetencion[ cxcCodigoDetRet=" + cxcCodigoDetRet + " ]";
    }
    
}
